<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:27:"themes/admin/group-del.html";i:1568365182;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/themes/admin/assets/css/layui.css">
    <script src="/themes/admin/assets/layui.js"></script>
  <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<form class="layui-form" action="">
  <div class="layui-form-item">
    <label class="layui-form-label">用户组名</label>
    <div class="layui-input-inline">
      <input type="text" id="groupTitle" required  lay-verify="required" placeholder="请输入用户组名" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <div class="layui-input-block">
      <button type="button" onclick="delGroup()" class="layui-btn">立即提交</button>
    </div>
  </div>
</form>

  <script>
    layui.use("layer");
    layui.use('form')
  var delGroup = function(){
    var groupTitle = $("#groupTitle").val();
      $.ajax({
        type:"POST",
        data:{title:groupTitle},
        url:"/admin/user/addGroup",
        success:function(e){
        if(e.code == 1){
          layer.msg(e.msg, {icon: 1});
          setTimeout(function(){
          location.href = "/admin/user/ruleDetail?id="+e.groupId;
          },1500)
        }else{
           layer.msg(e.msg, {icon: 5});
        }
        }
      })
    }
  </script>
</body>
</html>